<template>
    <div>
        <!-- 无子产品：只有版本号 或者有子产品，不统一发版的：版本号后面加子产品名称  -->
        <VersionTreeA v-bind="$attrs" :signPostShowType="signPostShowType" v-if="['1', '3'].includes(signPostShowType)" @success="handleSuccess" />
        <!-- 有子产品，统一发版的：只显示版本号，然后展开显示子产品-->
        <VersionTreeB v-bind="$attrs" :signPostShowType="signPostShowType" v-if="signPostShowType === '2'" @success="handleSuccess" />
    </div>
</template>

<script lang="ts">
import VersionTreeA from './VersionTreeA/index.vue';
import VersionTreeB from './VersionTreeB/index.vue';
import { defineComponent } from 'vue';
export default defineComponent({
    components: {
        VersionTreeA,
        VersionTreeB
    },
    props: {
        signPostShowType: {
            type: String,
            default: ''
        }
    },
    emits: ['success'],
    setup(props, { emit }) {
        const handleSuccess = () => {
            emit('success');
        };
        return {
            handleSuccess
        };
    }
});
</script>
<style lang="less" scoped>
::v-deep(.ant-collapse-content > .ant-collapse-content-box) {
    padding-bottom: 8px !important;
}
</style>